<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%--
  Created by IntelliJ IDEA.
  User: Ahuanlien
  Date: 2018/6/8
  Time: 12:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <%@include file="/static/common/commom.jsp" %>
    <script src="/static/js/employee.js"></script>
</head>
<body>
<table id="employee_dataGrid"></table>
<!--工具栏-->
<div id="tb">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" data-cmd="add">新增</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" data-cmd="edit">编辑</a>

    <shiro:hasPermission name="employee:changeState">
        <a href="#" id="state_btn" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
           data-cmd="changState">离职</a>
    </shiro:hasPermission>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" data-cmd="reload">刷新</a>

    <shiro:hasPermission name="employee:initPassword">
        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
           data-cmd="initPassword">重置密码</a>
    </shiro:hasPermission>

    <input class="easyui-textbox" name="keyword" prompt="请输入名称或电话">
    <input class="easyui-datebox" name="beginTime" prompt="入职开始时间"> -
    <input class="easyui-datebox" name="endTime" prompt="入职结束时间">
    <input class="easyui-combobox dept_combobox" name="dept.id" prompt="请选择部门"
           data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'/department/selectAll.do'"/>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" data-cmd="searchForm">查询</a>
</div>

<div id="btns">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" data-cmd="save">保存</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" data-cmd="cancel">取消</a>
</div>

<div id="employee_dialog">
    <form id="employee_form" method="post">
        <input id="employeeId" type="hidden" name="id">
        <table align="center">
            <tr>
                <td>用户名:</td>
                <td><input name="username" class="easyui-textbox" required="true" prompt="请输入用户名"
                           invalidMessage="用户名已存在"
                           validType="remote['/employee/validateUsername.do?id='+employeeId.value,'username']"
                ></td>
            </tr>
            <tr>
                <td>真实名:</td>
                <td><input name="realname" class="easyui-textbox" required="true" prompt="请输入真实名"></td>
            </tr>

            <tr id="password_tr">
                <td>密码:</td>
                <td><input name="password" id="password" class="easyui-passwordbox" prompt="请输入密码"></td>
            </tr>

            <tr>
                <td>部门:</td>
                <td><input name="dept.id" class="easyui-combobox"
                           data-options="panelHeight:'auto',textField:'name',valueField:'id',url:'/department/selectAll.do'"
                ></td>
            </tr>
            <tr>
                <td>邮箱:</td>
                <td><input name="email" class="easyui-textbox"></td>
            </tr>
            <tr>
                <td>电话:</td>
                <td><input name="tel" class="easyui-textbox"></td>
            </tr>
            <tr>
                <td>入职时间:</td>
                <td><input name="hireDate" class="easyui-datebox"></td>
            </tr>
            <tr>

                <td>管理员:</td>
                <td><input name="admin" class="easyui-combobox"
                           data-options='{
                           data:[
                           {"value":1,"text":"是"}
                           ,{"value":0,"text":"否"}
                           ],
                           textField:"text",valueField:"value",panelHeight:"auto"
                           }'></td>
            </tr>

            <tr>
                <td>角色:</td>
                <td><input id="relo_combobox" class="easyui-combobox"
                           data-options="
                           url:'/role/selectAll.do',
                           multiple:true,
                           panelHeight:'auto',
                           textField:'name',
                           valueField:'id'
                           "></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>